<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./vue.global.js"></script>
</head>
<body>
    <div id="app">
        <my-head></my-head>
    </div>
    <script>
        let app = Vue.createApp({
            data(){
                return {
                }
            }
        })

        app.component(
            //两种方式注册组件都可以
            //'my-head',
            'MyHead',
            {
                template: `
                <div>{{msg}}</div>
                <header>
                    <h2>logo</h2>
                    <ul>
                        <li>首页</li>
                        <li>视频</li>
                        <li>音乐</li>
                    </ul>
                </header>
                `,
                data(){
                    return {
                        msg: 'hello world'
                    }
                },
                mounted(){
                    setTimeout(()=>{
                        this.msg = 'hello vue'
                    },2000)
                }
            })

        let vm = app.mount('#app');
    </script>

</body>
</html>